<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  const interface = {
    call:function(){
      console.log("打电话");
    },
    sms:function(){
      console.log("发短信");
    }
  }

  function phoneClass(c, s, w){
    return {
      ...interface,
      color: c,
      size: s,
      weight: w
    }
  }

  const phone1 = phoneClass("白色", "10寸", "300g");
  const phone2 = phoneClass("黑色", "7寸", "400g");

  console.log(phone1);
  console.log(phone2);

  console.log(phone1 === phone2);

  console.log(phone1.call === phone2.call); // true
  
</script>
</html>